import { Request } from "../request/request";

//封装接口
// 例：
//stater
// 吴佩蓉
// 生成小程序二维码
module.exports.unlimit = (data) => Request({
  url:`/qrcode/wxa/unlimit?scene=${data.scene}`,
  method:"post",
  data
})
module.exports.Banner = () => Request({
  url: "/banner/list",
  method: "get",
})
// 我的
// 登陆
module.exports.logina = (data) => Request({
  url: `/user/wxapp/login`,
  method: "get",
  data
})
// 退出登陆
module.exports.outlogin = (data) => Request({
  url: `/user/loginout`,
  method: "get",
  data
})

// 注册
module.exports.zhuce = (obj) => Request({
  url: `/user/wxapp/register/simple?code=${obj}`,
  method: "post",
  data:obj
})
// 用户资产
module.exports.zichan = (data) => Request({
  url: `/user/amount?token=${data}`,
  method: "get",
  data
})
// 获取订单列表
module.exports.orderlist = (data) => Request({
  url: `/order/list?token=${data}`,
  method: "post",
  data
})
// 获取商品收藏列表
module.exports.shoucang = (data) => Request({
  url: `/shop/goods/fav/list`,
  method: "post",
  data
})
//  商品删除
module.exports.delgood = (data) => Request({
  url: `/shop/goods/fav/delete?goodsId=${data.goodsId}&token=${data.token}`,
  method: "post",
  data
})
//  每日签到
module.exports.qiandao = (data) => Request({
  url: `/score/sign?token=${data}`,
  method: "post",
  data
})
//  获取购物车
module.exports.cart = (data) => Request({
  url: `/shopping-cart/info?token=${data}`,
  method: "get",
})
//  修改购物车数量
module.exports.cartbian = (data) => Request({
  url: `/shopping-cart/modifyNumber`,
  method: "post",
  data
})
// 购物车删除商品
module.exports.delgoods = (data) => Request({
  url: `/shopping-cart/remove`,
  method: "post",
  data
})
// 商品分类
module.exports.fenlei = (data) => Request({
  url: `/shop/goods/category/all?token=${data}`,
  method: "get",
})
// 商品分类表
module.exports.fenleigoods = (data) => Request({
  url: `/shop/goods/list`,
  method: "post",
  data
})
// 添加购物车
module.exports.addshop = (data) => Request({
  url: `/shopping-cart/add`,
  method: "post",
  data
})
// 商品详情
module.exports.goodxq = (data) => Request({
  url: `/shop/goods/detail?id=${data.id}&token=${data.token}`,
  method: "get",
})
// 商品收藏
module.exports.goodshoucang = (data) => Request({
  url: `/shop/goods/fav/add`,
  method: "post",
  data
})
// 检测是否收藏
module.exports.shoucanga = (data) => Request({
  url: `/shop/goods/fav/check?token=${data.token}&goodsId=${data.goodsId}`,
  method: "get",
})
// 添加收货地址
module.exports.adddizhi = (data) => Request({
  url: `/user/shipping-address/add`,
  method: "post",
  data
})
// 收货地址
module.exports.getdizhi = (data) => Request({
  url: `/user/shipping-address/list?token=${data.token}`,
  method: "get",
})
// 修改收货地址
module.exports.editaddress = (data) => Request({
  url: `/user/shipping-address/update`,
  method: "post",
  data
})
// 删除收货地址
module.exports.deladdress = (data) => Request({
  url: `/user/shipping-address/delete`,
  method: "post",
  data
})
// 李玉
module.exports.Banner = () => Request({
  url: "/banner/list",
  method: "get",
})
// 通告栏
module.exports.Ly_board=()=>Request({
  url:"/notice/list",
  method:"post",
})
// 九宫格
module.exports.Ly_shopGoods=()=>Request({
  url:"/shop/goods/category/all",
  method:"get",
})
// 商品列表
module.exports.Ly_shopList=()=>Request({
  url:"/shop/goods/list",
  method:"post",
})